<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    .box{
      width: 200px;
      height: 200px;
      background-color: red;
    }
  </style>
</head>
<body>
  <div class="box"></div>
  <script>
    var box = document.querySelector('.box');
    var startX,startY,endX,endY
    box.addEventListener('touchstart',function(e){
      startX = e.targetTouches[0].clientX;
      startY = e.targetTouches[0].clientY;
    });
    box.addEventListener('touchend',function(e){
      endX = e.changedTouches[0].clientX;
      endY = e.changedTouches[0].clientY;
      if(Math.abs(endX - startX) < 10 && Math.abs(endY - startY) < 10){
        alert('被点击了');
      }else{
        alert('这不是点击');
      }
    });
  </script>
</body>
</html>